package com.example.orderminiappapi.dao;

import com.example.orderminiappapi.bean.Meal;
import com.example.orderminiappapi.bean.OrderItem;
import com.example.orderminiappapi.bean.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MealDao {
    List<Meal> getShopMeals(Shop shop);

    /**
     * 后台管理相关接口
     * */
    int doAddMeal(Meal meal);           // 商家添加菜品

    int doUpdateMeal(Meal meal);        // 商家修改菜品

    int updateGround(Meal meal);        // 菜品的上架/下架

    int getAllShopMealsCount(Shop shop);         // 所有商店的菜品总数

    int deleteMealItem(Meal meal);      //  删除菜品

    Meal selectOneMeal(Meal meal);      //  删除菜品

    int completeOrder(OrderItem orderItem);     // 完成订单，菜品销量+1
}
